<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ejs模板引擎</title>
</head>

<body>
    <form action="/gather/" name="myForm" id="myForm">

        <select id="select" name="select">
               <option value="1">苹果CMS</option>

         </select>

        <input type="text" id="url" name="url" />
        <input type="button" id="save" onclick="saveData()" value="提交">
    </form>



    <h2>nice 今天天气挺不错 今天是日 看一下今天的电影排行条目</h2>
    <ul>
        <%=title %>
    </ul>
    <h2>一下是阅读量大于1000的电影条目</h2>
    <ul>
        <%=message %>
    </ul>
</body>

</html>

<script>
    function saveData() {
        var type = document.getElementById("select").value;
        var url = document.getElementById("url").value;
        document.getElementById('myForm').action = "/gather/" + type + "/" + encodeURIComponent(url);

        document.getElementById("myForm").submit();
    }
</script>